/**  系统管理 相关接口 */

import {
  httpRequest
} from './index'

/** 角色 */
/** 角色列表 */
export const GetRoleAllList = (params) => httpRequest('role/all', params, 'GET')
export const GetRoleList = (params) => httpRequest('role/list', params, 'GET')
export const AddRole = (params) => httpRequest('role/create', params)
export const EditRole = (params) => httpRequest('role/update', params)
export const GetRolePermission = (params) => {
  return httpRequest('role/permission/' + params.id, {}, 'GET')
}
export const SetRolePermission = (params) => httpRequest('role/permission/update', params)

export const GetAllPermissionTree = (params) => httpRequest('permission/treeList', params, 'GET')
export const GetAllPermissionList = (params) => httpRequest('permission/treeList', params, 'GET')
export const GetLoginUserPermissionList = (params) => httpRequest('permission/allList', params, 'GET')

/** 用户 */
/** 系统用户列表 */
export const GetUserList = (params) => httpRequest('admin/list', params, 'GET')
export const AddUser = (params) => httpRequest('admin/create', params)
export const EditUser = (params) => httpRequest('admin/update', params)
export const RemoveUser = (params) => httpRequest('admin/delete', params)
/** 禁用用户 */
export const DisableUser = (params) => httpRequest('admin/disable', params)
/** 启用用户 */
export const EnableUser = (params) => httpRequest('admin/enable', params)

/** 店铺 */
export const GetStoreList = (params) => httpRequest('shop/list', params, 'GET')
export const GetStoreAllList = (params) => httpRequest('shop/listAll', params, 'GET')
export const GetStoreDetail = (params) => httpRequest('shop/info/' + params, {}, 'GET')
export const UpdateStore = (params) => httpRequest('shop/update', params)
export const DeleteStore = (params) => httpRequest('shop/delete', params)
export const AddStore = (params) => httpRequest('shop/create', params)
